win32 theme: No need to create a DC for GetThemePartSize
authorJaime Velasco Juan <jsagarribay@gmail.com>
Fri, 14 Oct 2016 08:24:13 +0000 (09:24 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 26 Oct 2016 14:25:49 +0000 (16:25 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=773221

gtk/gtkwin32theme.c

index 0b960511bb1f15f0c21a726c010020e02fd98456..c5f66dd4046b59c375a0d96617667c07eb89fe61 100644 (file)
@@ -453,14 +453,11 @@ gtk_win32_theme_get_part_size (GtkWin32Theme  *theme,
 #ifdef G_OS_WIN32
   HTHEME htheme = gtk_win32_theme_get_htheme (theme);
   SIZE size;
-  HDC hdc;
   HRESULT res;
 
   if (use_xp_theme && GetThemePartSize != NULL && htheme != NULL)
     {
-      hdc = GetDC (NULL);
-      res = GetThemePartSize (htheme, hdc, part, state, NULL, 1 /* TS_TRUE */, &size);
-      ReleaseDC (NULL, hdc);
+      res = GetThemePartSize (htheme, NULL, part, state, NULL, 1 /* TS_TRUE */, &size);
 
       if (SUCCEEDED (res))
         {